var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, i) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var i in e)
              Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
          })(e, i);
      };
      return function (e, i) {
        function n() {
          this.constructor = e;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        t(e, i),
          (e.prototype =
            null === i
              ? Object.create(i)
              : ((n.prototype = i.prototype), new n()));
      };
    })(),
  AXMagicInlayDialog = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        (e.onLoadMagicInsertDataFn = {
          caller: e,
          code: 1090,
          method: function (t) {
            if (0 == t.code) {
              e.listArr = t.data;
              var i;
              e.dataSource = [];
              for (var n = 0; n < e.listArr.length; n++)
                (i = {
                  lbl_magArmyName: { text: e.listArr[n].name },
                  lbl_magArmysubContent: { text: e.listArr[n].stoneStr },
                  btn_baoshititle: { label: "镶嵌" },
                }),
                  e.dataSource.push(i);
              e.list_magicInlay.dataSource = e.dataSource;
            }
          },
        }),
        (e.onLoadXiangQianDataFn = {
          caller: e,
          code: 1092,
          method: function (t) {
            0 != t.code
              ? ToastView.toastView(t.msg)
              : (e.close(),
                ToastView.toastView(t.data),
                WebSocketService.send({ c: 6034, d: { pageNum: 0 } }));
          },
        }),
        WebSocketService.addListener(e.onLoadMagicInsertDataFn),
        WebSocketService.addListener(e.onLoadXiangQianDataFn),
        (e.list_magicInlay.selectEnable = !0),
        (e.list_magicInlay.vScrollBarSkin = ""),
        e.list_magicInlay.on(Laya.Event.CLICK, e, e.onlistMagicInlayDidClickFn),
        e
      );
    }
    return (
      __extends(e, t),
      (e.showInsertBaoShiView = function (t) {
        null == this.insertView &&
          ((this.insertView = new e()), (this.insertView.zOrder = 1e3)),
          this.insertView.popup(!0),
          (this.insertView.jsonObj = t),
          (this.insertView.label_magic_title.text = t.name),
          WebSocketService.send({ c: 1090, d: { id: t.id } });
      }),
      (e.prototype.onlistMagicInlayDidClickFn = function (t) {
        "" != t.target.name &&
          WebSocketService.send({
            c: 1092,
            d: {
              id: this.jsonObj.id,
              aid: this.listArr[this.list_magicInlay.selectedIndex].id,
            },
          });
      }),
      (e.close = function () {
        this.insertView && this.insertView.close();
      }),
      e
    );
  })(ui.TabBarItemController.AXMagicInlayDialogUI);
